<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java循环语句完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 12px;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        .section-title {
            position: relative;
            display: inline-block;
            padding-bottom: 0.5rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 2px;
        }
        
        .feature-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            margin-bottom: 1rem;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 1.5rem;
            border-radius: 16px;
            margin: 2rem 0;
            box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
        }
        
        .practice-card {
            background: white;
            border-left: 4px solid #667eea;
            padding: 1.5rem;
            margin: 1rem 0;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6 text-center">
            <h1 class="text-5xl md:text-6xl font-bold mb-6 animate-pulse">
                <i class="fas fa-code mr-4"></i>Java循环语句完全指南
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">掌握编程的核心力量，让代码优雅地重复执行</p>
            <div class="flex justify-center space-x-8 text-lg">
                <div class="flex items-center">
                    <i class="fas fa-bullseye mr-2"></i>
                    <span>精准控制</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-rocket mr-2"></i>
                    <span>高效执行</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-infinity mr-2"></i>
                    <span>无限可能</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12">
        <!-- 学习目标 -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 section-title">
                <i class="fas fa-flag-checkered mr-3 text-purple-600"></i>学习目标
            </h2>
            <div class="grid md:grid-cols-3 gap-6 mt-8">
                <div class="text-center">
                    <div class="feature-icon mx-auto">
                        <i class="fas fa-book-open"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">掌握循环语句</h3>
                    <p class="text-gray-600">深入学习Java中的各种循环语句结构</p>
                </div>
                <div class="text-center">
                    <div class="feature-icon mx-auto">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">理解差异</h3>
                    <p class="text-gray-600">掌握for循环和while循环的用法及区别</p>
                </div>
                <div class="text-center">
                    <div class="feature-icon mx-auto">
                        <i class="fas fa-lightbulb"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">灵活运用</h3>
                    <p class="text-gray-600">能够灵活运用循环语句解决实际问题</p>
                </div>
            </div>
        </section>

        <!-- 循环概念 -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 section-title">
                <i class="fas fa-sync-alt mr-3 text-purple-600"></i>循环的概念
            </h2>
            <p class="text-lg leading-relaxed text-gray-700">
                <span class="drop-cap">在</span>Java编程中，循环语句是一种重要的控制结构，用于重复执行特定的代码块。掌握循环语句可以提高程序的效率和可维护性。循环让我们能够用简洁的代码完成重复性的任务，是编程中不可或缺的工具。
            </p>
            
            <div class="mermaid mt-8">
                graph LR
                    A[开始] --> B{条件判断}
                    B -->|条件为真| C[执行循环体]
                    C --> D[更新循环变量]
                    D --> B
                    B -->|条件为假| E[结束循环]
                    style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style E fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style B fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#4facfe,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#43e97b,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </section>

        <!-- For循环 -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 section-title">
                <i class="fas fa-repeat mr-3 text-purple-600"></i>For循环
            </h2>
            
            <div class="highlight-box">
                <p class="text-lg font-semibold">
                    <i class="fas fa-info-circle mr-2"></i>
                    For循环是一种常用的循环结构，通常用于<strong>已知循环次数</strong>的情况下。
                </p>
            </div>

            <div class="grid md:grid-cols-2 gap-6 mt-8">
                <div>
                    <h3 class="text-xl font-bold mb-4 text-purple-700">
                        <i class="fas fa-star mr-2"></i>特点
                    </h3>
                    <ul class="space-y-3">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>最常用的循环结构之一，适用于已知循环次数的情况</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>由三个部分组成：初始化表达式、循环条件、更新表达式</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>初始化表达式在循环开始前执行一次</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>可以遍历数组或集合等数据结构</span>
                        </li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-xl font-bold mb-4 text-purple-700">
                        <i class="fas fa-code mr-2"></i>语法格式
                    </h3>
                    <div class="code-block">
                        <pre>for (初始化语句; 循环条件; 更新语句) {
    // 循环体
}</pre>
                    </div>
                </div>
            </div>

            <h3 class="text-xl font-bold mt-8 mb-4 text-purple-700">
                <i class="fas fa-laptop-code mr-2"></i>示例代码
            </h3>
            <div class="grid md:grid-cols-2 gap-4">
                <div class="code-block">
                    <pre>// 基础示例
for (int i = 0; i < 5; i++) {
    System.out.println("当前数字：" + i);
}</pre>
                </div>
                <div class="code-block">
                    <pre>// 输出1-100所有奇数
for(int i = 1; i < 101; i += 2){
    System.out.println(i);
}</pre>
                </div>
            </div>

            <div class="practice-card mt-8">
                <h4 class="text-lg font-bold mb-3">
                    <i class="fas fa-pencil-alt mr-2 text-purple-600"></i>课堂练习
                </h4>
                <p>实现打印100遍的"我爱你"</p>
            </div>

            <div class="practice-card">
                <h4 class="text-lg font-bold mb-3">
                    <i class="fas fa-dumbbell mr-2 text-purple-600"></i>强化练习
                </h4>
                <ol class="list-decimal list-inside space-y-2">
                    <li>请在控制台输出数据1-10</li>
                    <li>请在控制台输出数据10-1</li>
                    <li>求出1-10之间数据之和</li>
                    <li>求出1-100之间能够被3整除的所有数的和</li>
                </ol>
            </div>
        </section>

        <!-- While循环 -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 section-title">
                <i class="fas fa-circle-notch mr-3 text-purple-600"></i>While循环
            </h2>
            
            <div class="highlight-box">
                <p class="text-lg font-semibold">
                    <i class="fas fa-info-circle mr-2"></i>
                    While循环是一种适用于未知循环次数的情况下的循环结构，循环条件为true时执行循环体，直到条件为false时结束循环。
                </p>
            </div>

            <div class="grid md:grid-cols-2 gap-6 mt-8">
                <div>
                    <h3 class="text-xl font-bold mb-4 text-purple-700">
                        <i class="fas fa-star mr-2"></i>特点
                    </h3>
                    <ul class="space-y-3">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>在循环开始前仅检查循环条件</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>适用于未知循环次数的情况</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>